package com.eiisan.user.mapper;

import com.eiisan.user.model.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description: UserMapper
 * @Author gragonfly
 * @Date 2019/6/26
 **/
@Mapper
public interface UserMapper {

    @Insert("INSERT INTO `tb_user` (`id`,`user_name`,`nick_name`,`mobile`,`email`,`password`,`sex`,`user_status`,`role_id`,`create_time`) VALUES (null,#{userName},#{nickName},#{mobile},#{email},#{password},#{sex},#{userStatus},#{roleId},#{createTime})")
    int register(User user);

    @Select("SELECT * FROM `tb_user` where MOBILE = #{mobile} ")
    User getUserByMobile(String mobile);

    @Select("SELECT * FROM `tb_user` ")
    List<User> finAllTest();
}
